/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	ActorManager.h
*
*	Description -	Actor manager. 
*
*	Comments	-
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	10/20/2012	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_ACTOR_MANAGER_H_
#define _PSX_ACTOR_MANAGER_H_

#include "PulseSTD.h"
#include "Map.h"
#include "Actor.h"
#include "XMLParser.h"
#include "LockFreeQueue.h"

namespace Pulse
{
	class FactoryActor
	{
	public:

		FactoryActor( void );

		~FactoryActor( void );

		ActorPtr NewActor( void );

		// NOTE: Creates an already defined actor 
		ActorPtr NewActor( XMLElementPtr pActorInit);

		EErrorCode::Type RemoveActor( const ActorPtr &pActor );

	private:

		ActorPtr _NewActor( void );

		void IncrementID( void );

	private:

		typedef List<const ActorID> ActorIDList;
		typedef Map< ActorID, Actor*> ActorMap;

		ActorID			m_newActorID;
		ActorMap		m_actors;
		ActorIDList		m_availableIDs; // 
	};
}

#endif /* _PSX_ACTOR_MANAGER_H_ */